<? ob_start(); ?>
<?php
 $uid = $_GET["uid"];
 $db = mysql_connect("mysql513.in.shared-server.net:16033", "JRtu434", "qvoiceDB1");
 mysql_select_db("JRtu434", $db);
 
 $sql = "select * from testredirect where ID='" . $uid . "'";
 $res = mysql_query($sql);
 if(!mysql_num_rows($res)) {
 header("Location: http://www.q-voice.net/public/thanks/ssg");
 }
 else
 {
 $res = mysql_query($sql);
 $item = mysql_fetch_array($res);
 $nurl = $item['url'].$uid;
 }
 header("HTTP/1.1 301 Moved Permanently");
 header("Location: " . $nurl);
 mysql_close();
?>
<? ob_flush(); ?> 
<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 
<html lang="ja"> 
 
<!-- ==== document header ==== --> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<meta http-equiv="Content-Style-Type" content="text/css"> 
<meta http-equiv="Content-Script-Type" content="text/javascript"> 
<title>アンケート画面に移動します</title> 
</head> 
<center>
<a href="http://www.q-voice.net/public/thanks/ssg">こちらをクリックください</a>
</center>

</html>
